/* Copyright (C) Nial Peters 2013
 *
 * This file is part of pydoas.
 *
 * pydoas is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * pydoas is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with pydoas.  If not, see <http://www.gnu.org/licenses/>.
 *
 * The code in this file is modified from
 * http://blog.enthought.com/python/numpy-arrays-with-pre-allocated-memory/
 */

#ifndef AUTODEALLOC_NUMPY_H
#define AUTODEALLOC_NUMPY_H

#include"Python.h"
#include<numpy/arrayobject.h>
#include<assert.h>

typedef struct {
	PyObject_HEAD
	void *memory;
} AutoDeallocObject;

PyObject *  createAutoDeallocNumpyArray (int nd, npy_intp* dims, int typenum, void *data);
void 		import_autodealloc_numpy    (void);

#endif //AUTODEALLOC_NUMPY_H
